Welcome![Sign In][Sign Up]
Location:
Search - c tcp

Search list

[WinSock-NDISTCP实现客户服务器聊天程序

Description:

 

操作系统课程设计任务书


一、设计题目:多机进程通信

应用Socket进程通信技术编写聊天室程序,实现基于服务器的并发多机信息转发。如果各客户端在线则可以实时聊天、发送接收文件,如果某客户端离线,则发送给他的消息可由服务器端进行内容缓存,待重新连线后可以自动接收通过服务器转发的信息或文件。缓存与转发的控制算法可参考操作系统课程中生产者消费者进程同步方法、缓冲池技术等相关理论。
二、设计思路和功能的详细描述
采用TCP协议,所以属于客户机/服务器模式,因此需要聊天服务器端和聊天客户端两个程序,实现的功能是:任意一台装有客户端程序的计算机都可以通过服务器端的IP地址与服务器相连,然后进入聊天室与连接到服务器的其他客户进行聊天。当客户聊天结束时,可以点断开与服务器断开连接,以释放进程让其他等待的客户进入聊天室,本聊天室最大同时支持50个客户端的连接,如果服务器配置较高可以修改程序来增加同时连接数。
三、采用的方法、技术、运行环境及其配置
本聊天程序采用TCP协议,用VC++编写,属于客户机/服务器模式。采用了多线程的机制。其中使用windows Sockets实现多台计算机(多个进程)间的通信,SOCKET实际在计算机中提供了一个通信端口,可以通过这个端口与任何一个具有SOCKET接口的计算机通信。应用程序在网络上传输,接收的信息都通过这个SOCKET接口来实现。客户机/服务器模式中客户应用程序向服务器程序请求服务。一个服务程序通常在一个众所周知的地址监听对服务的请求,也就是说,服务进程一直处于休眠状态,直到一个客户对这个服务的地址提出了连接请求。在这个时刻,服务程序被“惊醒”并且为客户提供服务即对客户的请求作出适当的反应。本聊天程序就是基于这中思想实现的,程序分为两大部分:TCP聊天服务器端和TCP聊天客户端。两者都拥有各自的SOCKET接口,其中服务器端SOCKET接口需要绑定到固定地址上(实现语句:ock=Socket(AF_INET,SOCK_STREAM,0);),等待客户端的连接(实现语句:listen(sock,5);)。等待客户端的连接的过程就是通过多进程机制来实现的。
聊天程序是在VISUAL C++6.0上编译实现的,在WINDOWS2000,XP上测试运行成功。
对客户计算机配置无特殊要求,由于所设置的最大连接进程为50,所以对服务器要求也不高。
四、关键源程序及其详细的注释
<一>、服务器端
1
、Socket初始化
//
初始化对话框
BOOL CCSocketDlg::OnInitDialog()
{

count=0;

m_list.InsertColumn(0,"消息");

m_list.SetColumnWidth(0,435);

m_edit.SetLimitText(99);

.

.

.

.

 


Platform: | Size: 55808 | Author: lenjear | Hits:

[CSharpC# 聊天室 模拟群聊和私聊 源码

Description: c#编写的聊天室程序,运用tcp协议,通过自己编写通信协议已达到各客户端的通信,并带有上下线提醒功能
Platform: | Size: 229530 | Author: cwy1314 | Hits:

[SourceCodeC++

Description: 界面 TCP UDP 文件传输 信息发送
Platform: | Size: 2786668 | Author: hujie.best@163.com | Hits:

[Windows Developtcp socket

Description: 不错的c++源码就 基于windows 的socket
Platform: | Size: 293376 | Author: 846051197@qq.com | Hits:

[SourceCodelinux TCP UNIX domain

Description: 1、TCP UNIX 2、C/S Mode
Platform: | Size: 2240 | Author: arvin_fresh@sina.cn | Hits:

[Internet-Networklibtcp++-0.0.4.tar

Description: C++ TCP库 -C++ TCP lib
Platform: | Size: 7168 | Author: 站长 | Hits:

[Internet-Networktcp

Description: 站长写的Unix和Windows下的socket通用函数,简单易用。带Unix下的小例子- Stationmaster writes under Unix and the Windows socket general function, simple is easy to use. Brings under Unix the small example
Platform: | Size: 8192 | Author: 站长 | Hits:

[Internet-Networkc++builder之internet与tcp_ip程序设计高手

Description: c++builder之internet与tcp_ip程序设计高手-c++ builder of the internet and tcp_ip program design expert
Platform: | Size: 22488064 | Author: 姜力 | Hits:

[Linux-Unix串口连接程序c语言

Description: 在linux下把串口映射成TCP/IP端口- Maps under linux the string mouth the TCP/IP port
Platform: | Size: 98304 | Author: 刘宝文 | Hits:

[Windows Developtcp_http

Description: TCP的源库,好-TCP source-sink, good Dongdong
Platform: | Size: 15360 | Author: st | Hits:

[BooksC# 150 examples

Description: C#150例程序-C# 150 cases procedures
Platform: | Size: 1172480 | Author: 殷晶晶 | Hits:

[CSharpcSharp-tcp-ip

Description: C#编写的TCP/IP文字传输,可以连接到远程地址、端口,也可以监听本地端口-Written in C# TCP/IP Transfer, you can connect to the remote address, port, local port can monitor
Platform: | Size: 88064 | Author: jammylee | Hits:

[Internet-NetworkTCP

Description: C#写的基于TCP协议的服务器和客户端程序,实现简单的发送字符串的功能,适合初学者研究-Written in C# TCP protocol based server and client, simply send the string to achieve the function of research for beginners
Platform: | Size: 49152 | Author: SilverBullet | Hits:

[TCP/IP stackTCP-Chat

Description: C#TCP聊天室,包括完整的服务器端和客户端-C# TCP chat rooms, including a complete server and client
Platform: | Size: 122880 | Author: 潘德锋 | Hits:

[TCP/IP stackC#TCP-IP

Description: C#使用TCPIP做的客户端与服务器通信Modle源码(C# uses TCPIP to do client and server communications, Modle source code)
Platform: | Size: 5120 | Author: | Hits:

[TCP/IP stackC# tcp通信 登录 服务器端验证

Description: c#客户端和服务端进行TCP通信,是个非常好的学习网络编程例子(Client and server programming by TCP)
Platform: | Size: 422912 | Author: provencesl | Hits:

[Embeded-SCM DevelopC#TCP UDP(Source)

Description: 本软件实现调试助手的相关功能,通过TCP UDP两个协议可以传输数据,可供串口调试使用(This software implements debugging assistant related functions, through the TCP UDP two protocols can transfer data, can be used for debugging serial port)
Platform: | Size: 1401856 | Author: david_zn315 | Hits:

[Internet-NetworkTCP

Description: 异步实现的C# TCP编程客户端和服务器。使用的时候,自己新建工程,然后导入,即可使用(The asynchronous implementation of the C# TCP programming client and server. When you use it, you can build a new project, and then import it, you can use it.)
Platform: | Size: 67584 | Author: step.L | Hits:

[TCP/IP stackTCP通讯_异步 Socket_简单应用

Description: c# TCP通讯,利用异步的sokect流(c# TCP communication, using asynchronous sokect streams)
Platform: | Size: 76800 | Author: 卡夫特 | Hits:

[CSharpTCPIPDataToLIS

Description: winform C# TCP/IP Server Client 工程 2010 项目源码,最最基本的通讯。(winform C# TCP/IP Server Client Project source code, the most basic communication.)
Platform: | Size: 80896 | Author: agui802 | Hits:
« 1 23 4 5 6 7 8 9 10 ... 50 »

CodeBus www.codebus.net